<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>Document</title>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="item in arr">
            {{ item }}
        </li>
    </ul>
    <!-- 循环得到下标 -->
    <ul>
        <li v-for="(item, index) in arr">
            {{ item }}
            ->
            {{ index }}
        </li>
    </ul>

    <!-- 循环对象 -->
    <ul>
        <li v-for="(value,key,index) in json">
            {{value}}
            ->
            {{key}}
            ->
            {{index}}
        </li>
    </ul>
</div>
<script src="./vue.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            arr: ['a', 'b', 'c', 'd'],
            json: {
                name: '小明',
                age: 18,
                gender: '男'
            }
        }
    })
</script>
</body>
</html>